package cn.wl.shiro.util;


import cn.wl.crm.domain.Employee;
import org.apache.shiro.SecurityUtils;

/**
 *  操作session工具写法
 */
public class UserContext {

    public static void setEmployee(Employee employee){
        SecurityUtils.getSubject().
                getSession().setAttribute("loginUser",employee);
    }


    //就是得到
    public static Employee getEmployee(){
       return (Employee)SecurityUtils.getSubject().
               getSession().getAttribute("loginUser");
    }
}
